home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-02 / tool-inc.zip / GETTIME.INC < prev    next >
Text File  |  1989-06-02  |  1KB  |  60 lines

  1.  
  2. (*
  3.  * Copyright 1987, 1989 Samuel H. Smith;  All rights reserved
  4.  *
  5.  * This is a component of the ProDoor System.
  6.  * Do not distribute modified versions without my permission.
  7.  * Do not remove or alter this notice or any other copyright notice.
  8.  * If you use this in your own program you must distribute source code.
  9.  * Do not use any of this in a commercial product.
  10.  *
  11.  *)
  12.  
  13. (*
  14.  * gettime - get time of day from system clock
  15.  *
  16.  *)
  17.  
  18. function get_time: real;
  19. var
  20.    h,m,s,s1: word;
  21. begin
  22.    GetTime(h,m,s,s1);
  23.    get_time := int(s1)/ 100.0 +   {seconds/100}
  24.                int(s) +           {seconds}
  25.                int(m) * 60.0 +    {minutes}
  26.                int(h) * 3600.0;   {hours}
  27. end;
  28.  
  29. function lget_time: longint;
  30. var
  31.    h,m,s,s1: word;
  32. begin
  33.    GetTime(h,m,s,s1);
  34.    lget_time := longint(s) +                  {seconds}
  35.                 longint(m) * longint(60) +    {minutes}
  36.                 longint(h) * longint(3600);   {hours}
  37. end;
  38.  
  39. function lget_ms: longint;
  40. var
  41.    h,m,s,s1: word;
  42. begin
  43.    GetTime(h,m,s,s1);
  44.    lget_ms  := longint(s1)* longint(10) +      {seconds/100}
  45.                longint(s) * longint(1000) +    {seconds}
  46.                longint(m) * longint(60000) +   {minutes}
  47.                longint(h) * longint(3600000);  {hours}
  48. end;
  49.  
  50. function get_mins: integer;
  51. var
  52.    h,m,s,s1: word;
  53. begin
  54.    GetTime(h,m,s,s1);
  55.    get_mins := m + 60 * h;
  56. end;
  57.  
  58.  
  59.  
  60.